<?

if (!$user)
{
  include "page_personal_logon.php";
  return;
}

$PageTitle=$msg["Page_MyPlugins"];

include "div_menu_personal.php";

db_init_tags();

try 
{
  db_call();
  $all_plugs = db_read_plugins($user["id"]);

  print "<div class=\"myplugins\">\n";
  print "<div class=\"list_in\">\n";

  $n = count($all_plugs);
  if ($n == 0)
  {
    print "{$msg["NoPlugins"]}<br>\n";
    print "<br>\n";
  }

  print "<div class=\"add_div\">";
  print "<a href=\"pluginedit?id=\">{$msg["Add"]}</a>\n";
  print "</div>\n";

  if ($n > 0)
  {
    for ($i = 0; $i < $n; $i++) 
    {
      if ($i <> 0)
      {
         print "<div class=\"list_space\"></div>\n";
      }

      print "<div class=\"topic\">\n";
      print "<div class=\"topic_in\">\n";

      print "<div class=\"topic_in2\">\n";
      $plug = $all_plugs[$i];
      print_plug_wide($plug, "plugin?id=".$plug["id"]);
      print "</div>\n";
  
      print "</div>\n";
      print "</div>\n";
    }
  }

  print "</div>\n";
  print "</div> <!--myplugins-->\n";
} 
catch (Exception $e) 
{
  print_errors(array($e->getMessage()));
}

?>

